#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 6;
int n, a[N], ct;
bool vis[N];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    scanf("%d", &n);
    for(int i = 1; i <= n; ++ i) scanf("%d", &a[i]);
    sort(a+1, a+1+n, greater<int>());
    for(int i = 1, j = 2; j <= n;){
        if(vis[i] == 1) ++ i;
        else if(a[i] == a[j]) ++ j;
        else vis[i] = 1, ++ i, ++ j, ++ ct;
    }
    printf("%d", n - ct);
    return 0;
}
